package org.shinetour.sms.web.controller;

import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.shinetour.sms.web.page.TableDataInfo;


/**
 * @Description: web通用数据处理
 * @Author: ZhenHua Wang
 * @CreateDate: 2020/4/8 14:17
 */

public class BaseController {

    /**
     * @Description: 分页数据转换成TableDataInfo
     * @Author: ZhenHua Wang
     * @CreateDate: 2020/4/9 16:29
     */
    public  <T> TableDataInfo getTableDataInfo(Page<T> page) {
        TableDataInfo tableDataInfo = new TableDataInfo();
        tableDataInfo.setRows(page.getRecords());
        tableDataInfo.setTotal(page.getTotal());
        return tableDataInfo;
    }


}
